import {apiResquest} from '@/common/js/request.js'


// 获取全局应用配置
export const appConfig = () => {
	return apiResquest({
		url: '/api/web/appconfig',
		method: 'GET',
	})
}

// 获取验证码
export const getCaptcha = () => {
	return apiResquest({
		url: '/api/web/captcha',
		method: 'GET',
	})
}

// 注册
export const register = (data) => {
	return apiResquest({
		url: '/api/web/register',
		method: 'POST',
		data:data
	})
}

// 登录
export const login = (data) => {
	return apiResquest({
		url: '/api/web/login',
		method: 'POST',
		data:data
	})
}

// 退出登录
export const logout = () => {
	return apiResquest({
		url: '/api/web/logout',
		method: 'GET'
	})
}

// 找回密码
export const forgotpassword = (data) => {
	return apiResquest({
		url: '/api/web/forgotpassword',
		method: 'POST',
		data:data
	})
}

// 修改用户密码
export const changePwd = (data) => {
	return apiResquest({
		url: '/api/web/changepwd',
		method: 'POST',
		data:data
	})
}

// 获取邮箱验证码
export const captchaEmail = (data) => {
	return apiResquest({
		url: '/api/app/captchaemail',
		method: 'POST',
		data:data
	})
}

// 绑定邮箱
export const bindEmail = (data) => {
	return apiResquest({
		url: '/api/web/bindemail',
		method: 'POST',
		data:data
	})
}

//换绑邮箱
export const changeEmail = (data) => {
	return apiResquest({
		url: '/api/web/changeemail',
		method: 'POST',
		data:data
	})
}

// 获取用户信息
export const userInfo = () => {
	return apiResquest({
		url: '/api/web/userinfo',
		method: 'GET'
	})
}
